﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class admin_Admin : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.Cookies["texchange"] != null && Request.Cookies["texchange"]["logged"] != null && DAO.GlobalSettings.Decrypt(Request.Cookies["texchange"]["logged"]) == "true" && DAO.GlobalSettings.Decrypt(Request.Cookies["texchange"]["type"]) == "admin")
        {
            loggedAs.Text = (Request.Cookies["texchange"]["name"] != "") ? DAO.GlobalSettings.Decrypt(Request.Cookies["texchange"]["name"].ToString()) : "";
            lastLogin.Text = (Request.Cookies["texchange"]["lastlogin"] != "") ? DAO.GlobalSettings.Decrypt(Request.Cookies["texchange"]["lastlogin"].ToString()) : "";
        }
        else
        {
            Response.Redirect("~/admin/Login.aspx");
        }
        hlSignout.NavigateUrl = "~/admin/Logout.aspx";
        if (Session["message"] != null && Session["message"] != "")
        {
            ContentPlaceHolder1.Controls.Add(new LiteralControl("<span class='" + Session["message_type_css"].ToString() + "'>"
                    +Session["message"].ToString()+"</span>"));
            Session["message"] = null;
            Session["message_type_css"] = null;
        }
    }
}
